import uvicorn
from app.config import appSettings
from app.config import appLogger


# is_reload = appSettings.environment == 'development'
port = 28072 if appSettings.environment == 'development' else 80
if __name__ == "__main__":
    config = uvicorn.Config("app.main:app", host="0.0.0.0", port=port, log_level="info")
    server = uvicorn.Server(config)
    appLogger.info("Server Started", extra={"host": "0.0.0.0", "port": port})
    try:
      server.run()
    except Exception as e:
      appLogger.info("Server Started Error", extra={"exception": str(e)})
